package creational.singleton;

public class DoubleCheckSingleton {
    private DoubleCheckSingleton(){}
    private static DoubleCheckSingleton instance;

    public static DoubleCheckSingleton getInstance(){
        if(instance == null){
            synchronized(DoubleCheckSingleton.class){
                if(instance == null) instance = new DoubleCheckSingleton();
                return instance;
            }
        }
        return instance;
    }
}
